#pragma once

namespace gk
{
	struct Context
	{
		ContextType::Enum		m_type;

		void					BeginFrame();
		void					EndFrame();

		void					SetRenderTarget(RenderTargetHandle hRenderTarget);
		void					ClearRenderTarget(ClearType::Enum clearType, float r, float g, float b, float a, float depth, cr::uint8_t stencil);

		void					SetRenderBinding(RenderBindingHandle hRenderBinding);
		void					DrawIndexedPrimitives(BufferHandle hIndexBuffer, PrimitiveType::Enum primitiveType, cr::size_t indexCount, cr::size_t startIndex, cr::size_t vertexCount, cr::size_t startVertex);
		void					DrawPrimitives(PrimitiveType::Enum primitiveType, cr::size_t startVertex, cr::size_t numVertices);

		void					BeginGpuProgram(GpuProgramHandle hGpuProgram);
		void					EndGpuProgram();

		void					CommitConstantBuffer(ConstantBufferHandle hConstantBuffer);
		void					CommitGpuProgram();
		void					CommitStateBlock(StateBlockHandle hStateBlock);

		ContextInternal			m_internal;
	};

	typedef cr::Handle<Context> ContextHandle;
}